<html>
<head><meta charset="utf-8"><title>macOS initial cross-compile · t-compiler/arm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/index.html">t-compiler/arm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html">macOS initial cross-compile</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="202524094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524094">(Jul 01 2020 at 02:17)</a>:</h4>
<p>I was able to build <code>dev</code> successfully with <code>python3 x.py build --target ./aarch64-apple-darwin.json</code></p>



<a name="202524099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524099">(Jul 01 2020 at 02:17)</a>:</h4>
<p>then it dies when trying to build stage0, because aarch64-apple-darwin isn't in the listed triples</p>



<a name="202524113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524113">(Jul 01 2020 at 02:17)</a>:</h4>
<p>My understanding is that we will want to:</p>
<ol>
<li>Update LLVM to a new version</li>
<li>Compile Rust with the new LLVM (probably on / targeting x86_64 still) </li>
<li>Create a new target </li>
<li>Attempt to compile for that target</li>
</ol>
<p>/cc <span class="user-mention" data-user-id="317220">@André Arko</span></p>



<a name="202524169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524169">(Jul 01 2020 at 02:18)</a>:</h4>
<p>well, in some good news, x86_64 nightly works just fine</p>



<a name="202524187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524187">(Jul 01 2020 at 02:18)</a>:</h4>
<p>so I am trying to use the x86_64 as the bootstrap to build from source</p>



<a name="202524194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524194">(Jul 01 2020 at 02:18)</a>:</h4>
<p>and that works!</p>



<a name="202524202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524202">(Jul 01 2020 at 02:19)</a>:</h4>
<p>Are you familiar with <a href="https://rustc-dev-guide.rust-lang.org/">https://rustc-dev-guide.rust-lang.org/</a> ?</p>



<a name="202524203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524203">(Jul 01 2020 at 02:19)</a>:</h4>
<p>but apparently the --target json file doesn't get propagated to the stage0 build command</p>



<a name="202524299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524299">(Jul 01 2020 at 02:20)</a>:</h4>
<p>I am...somewhat familiar with it</p>



<a name="202524312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524312">(Jul 01 2020 at 02:20)</a>:</h4>
<p>I have built rust from source a bunch of times in the past, for MacOS in the pre-rustup days, and for avr more recently</p>



<a name="202524359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524359">(Jul 01 2020 at 02:21)</a>:</h4>
<p>You'll want to follow <a href="https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html">https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html</a></p>



<a name="202524421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524421">(Jul 01 2020 at 02:22)</a>:</h4>
<p>You won't need to follow the full process to start with; I tend to just to update my local checkout to some version of LLVM master and get that to compile.</p>



<a name="202524444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524444">(Jul 01 2020 at 02:23)</a>:</h4>
<p>a good thing about that is that many people are interested in keeping LLVM up-to-date</p>



<a name="202524500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524500">(Jul 01 2020 at 02:24)</a>:</h4>
<p>so getting help on it and getting any changes needed merged _should_ be straightforward.</p>



<a name="202524521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524521">(Jul 01 2020 at 02:24)</a>:</h4>
<p>See also <a class="stream" data-stream-id="187780" href="/#narrow/stream/187780-t-compiler.2Fwg-llvm">#t-compiler/wg-llvm</a></p>



<a name="202524522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524522">(Jul 01 2020 at 02:24)</a>:</h4>
<p>do I want the latest from the rust fork, or the latest from the main LLVM?</p>



<a name="202524601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524601">(Jul 01 2020 at 02:25)</a>:</h4>
<p>I'd <em>assume</em> main LLVM, <em>assuming</em> that it contains patches from Apple already. It's also possible you might need to pull from <a href="https://github.com/apple/llvm-project">Apple's fork of LLVM</a>.</p>



<a name="202524626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524626">(Jul 01 2020 at 02:26)</a>:</h4>
<p>haha ok</p>



<a name="202524722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524722">(Jul 01 2020 at 02:27)</a>:</h4>
<p>You might have to wrangle changes to LLVM APIs that have been updated as well. They break things reasonably frequently as they release new versions.</p>



<a name="202524842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524842">(Jul 01 2020 at 02:28)</a>:</h4>
<p>one thing that bites me frequently — once you've set <code>src/llvm-project</code> to some proper commit, you need to go back out of <code>llvm-project</code> and commit the submodule changes in the <code>rust</code> repository</p>



<a name="202524869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524869">(Jul 01 2020 at 02:29)</a>:</h4>
<p>Otherwise <code>x.py</code> will checkout a different commit than what you think is building and you will be very confused.</p>



<a name="202524904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202524904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202524904">(Jul 01 2020 at 02:29)</a>:</h4>
<p>ahhh yes that is very good advice <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="202525090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202525090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202525090">(Jul 01 2020 at 02:32)</a>:</h4>
<p>I'm about to head for bed, but I think if you have any general questions, you can also pop into <a class="stream" data-stream-id="182449" href="/#narrow/stream/182449-t-compiler.2Fhelp">#t-compiler/help</a> for a lot of this beginning process.</p>



<a name="202525185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202525185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202525185">(Jul 01 2020 at 02:34)</a>:</h4>
<p>great, thanks!</p>



<a name="202525196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202525196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202525196">(Jul 01 2020 at 02:34)</a>:</h4>
<p>I <em>think</em> the next step is to build a stage1 / stage2 compiler with the new LLVM, then  configure the build system to use that as the bootstrapping rustc (instead of the beta release), then try to perform the cross-compile build</p>



<a name="202525230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202525230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202525230">(Jul 01 2020 at 02:35)</a>:</h4>
<p>since I was able to compile pre-stage0 without updating LLVM, do you know if there is anything that depends on commits after the rust llvm?</p>



<a name="202525236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202525236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202525236">(Jul 01 2020 at 02:35)</a>:</h4>
<p>yeah, that makes sense</p>



<a name="202525267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202525267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202525267">(Jul 01 2020 at 02:35)</a>:</h4>
<p>I'm mostly just wondering how badly it will hurt to try to use nightly to bootstrap rust-lang HEAD by adding source level support for the target, and... who knows? maybe it's worth trying before updating all of LLVM</p>



<a name="202525307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202525307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202525307">(Jul 01 2020 at 02:36)</a>:</h4>
<p>thanks for the advice!</p>



<a name="202527543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202527543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202527543">(Jul 01 2020 at 03:28)</a>:</h4>
<p>even if updated LLVM turns out to not be required, you were right about needing to add the target and then compile a full x86 copy that can be used to build the arm64 copy, I think <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="202540317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202540317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202540317">(Jul 01 2020 at 07:54)</a>:</h4>
<p>so I think I made it to an actual platform issue?</p>



<a name="202540334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202540334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202540334">(Jul 01 2020 at 07:55)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0412]: cannot find type `c_char` in the crate root
  --&gt; /Users/andre/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.71/src/unix/mod.rs:45:29
   |
6  | pub type c_schar = i8;
   | ---------------------- similarly named type alias `c_schar` defined here
...
45 |         pub gr_name: *mut ::c_char,
   |                             ^^^^^^ help: a type alias with a similar name exists: `c_schar`
</code></pre></div>



<a name="202540437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202540437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202540437">(Jul 01 2020 at 07:56)</a>:</h4>
<p>my steps so far are:</p>
<ol>
<li>add aarch64-apple-darwin as a platform</li>
<li>build on x86_64, for x86_64, and copy the results to aarch64</li>
<li>use config.toml to point at stage0 cargo and stage2 rustc </li>
<li>python x.py build</li>
</ol>



<a name="202554573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202554573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202554573">(Jul 01 2020 at 10:48)</a>:</h4>
<p>Yes, that makes sense. Libc defines many basic types. C’s <code>char</code> is one of the most interesting because it can be signed, unsigned, or <em>neither</em>. It’s a strange quirk of history. </p>
<p>You’ll need to figure out what it should be and edit the libc crate. My guess is it will be the same as x86_64. You can probably just guess for a little while as well.</p>



<a name="202554637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202554637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202554637">(Jul 01 2020 at 10:49)</a>:</h4>
<p>I’m not sure how you can use a local fork of libc in the build process though.</p>



<a name="202555788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202555788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202555788">(Jul 01 2020 at 11:04)</a>:</h4>
<p>Although it looks like libc should <a href="https://github.com/rust-lang/libc/blob/d791c50036f4faf64d5fa33a0ff7307ba09591ab/src/unix/bsd/mod.rs#L869-L871">just be checking for if it's <code>macos</code></a></p>



<a name="202555822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202555822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202555822">(Jul 01 2020 at 11:04)</a>:</h4>
<p>And it's defined as </p>
<div class="codehilite"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">type</span> <span class="nc">c_char</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kt">i8</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="202555874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202555874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202555874">(Jul 01 2020 at 11:05)</a>:</h4>
<p>How is your target defined? Is it not called macos?</p>



<a name="202597014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202597014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202597014">(Jul 01 2020 at 17:17)</a>:</h4>
<p>I basically zombied together a target from the existing x86_64-apple-darwin and the aarch64-apple-ios targets, but maybe I'm doing it wrong <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="202597021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202597021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202597021">(Jul 01 2020 at 17:17)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...indirect:aarch64-apple-darwin">https://github.com/rust-lang/rust/compare/master...indirect:aarch64-apple-darwin</a></p>



<a name="202597121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202597121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202597121">(Jul 01 2020 at 17:18)</a>:</h4>
<p>ah yep my bad! the target_os should be macos looks like</p>



<a name="202597159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202597159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202597159">(Jul 01 2020 at 17:19)</a>:</h4>
<p>based on <a href="https://github.com/indirect/rust/blob/2a047ec496cdca548780612a32fc139a1f9d94a6/src/librustc_target/spec/x86_64_apple_darwin.rs#L26">https://github.com/indirect/rust/blob/2a047ec496cdca548780612a32fc139a1f9d94a6/src/librustc_target/spec/x86_64_apple_darwin.rs#L26</a></p>



<a name="202599620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202599620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202599620">(Jul 01 2020 at 17:39)</a>:</h4>
<p>The mix-and-match process is about what I'd expect. Filling out exactly what should be in that target will take some knowledge (that I don't have) as well as some experimentation, I'm sure.</p>



<a name="202599649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202599649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202599649">(Jul 01 2020 at 17:39)</a>:</h4>
<p>One thing to throw out there is <a href="https://github.com/rust-lang/rust/pull/73903">https://github.com/rust-lang/rust/pull/73903</a></p>



<a name="202599685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202599685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202599685">(Jul 01 2020 at 17:39)</a>:</h4>
<p>I don't know if it's directly relevant, but it's in the area.</p>



<a name="202599696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202599696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202599696">(Jul 01 2020 at 17:39)</a>:</h4>
<p>ah yeah, thanks</p>



<a name="202599758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202599758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202599758">(Jul 01 2020 at 17:40)</a>:</h4>
<p>one thing you probably do know is how to better set up a bootstrapping chain</p>



<a name="202599791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202599791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202599791">(Jul 01 2020 at 17:40)</a>:</h4>
<p>so I have a new commit that changes the target</p>



<a name="202599922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202599922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202599922">(Jul 01 2020 at 17:41)</a>:</h4>
<p>so now I need to make x.py use the x86_64 rustc to build... I guess an updated x86_64 rustc, with the new target def?</p>



<a name="202600027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600027">(Jul 01 2020 at 17:42)</a>:</h4>
<p>I assume you followed the defaults and got a <code>build</code> directory?</p>



<a name="202600158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600158">(Jul 01 2020 at 17:43)</a>:</h4>
<p>yeah, so far I have scp'ed the <code>build</code> directory from my x86 laptop over to the DTK</p>



<a name="202600261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600261">(Jul 01 2020 at 17:44)</a>:</h4>
<p>feels like I should be able to do better than that, but I don't know how, heh</p>



<a name="202600424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600424">(Jul 01 2020 at 17:45)</a>:</h4>
<p>So you have a <code>build/x86_64-apple-darwin/stage0/bin/rustc</code> ?</p>



<a name="202600436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600436">(Jul 01 2020 at 17:45)</a>:</h4>
<p>yep</p>



<a name="202600445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600445">(Jul 01 2020 at 17:45)</a>:</h4>
<p>(and stage1, stage2)</p>



<a name="202600594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600594">(Jul 01 2020 at 17:46)</a>:</h4>
<p>And if you run <code>build/x86_64-apple-darwin/stage1/bin/rustc --print target-list</code>, do you see your newly-defined target?</p>



<a name="202600652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600652">(Jul 01 2020 at 17:47)</a>:</h4>
<p>well, I see that it exists... but now I need to update it <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="202600673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600673">(Jul 01 2020 at 17:47)</a>:</h4>
<p>maybe I just need to compile a new stage1 on my laptop and copy it over again heh</p>



<a name="202600768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600768">(Jul 01 2020 at 17:48)</a>:</h4>
<p>so, in _general_, you can put the target as a JSON file</p>



<a name="202600791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600791">(Jul 01 2020 at 17:48)</a>:</h4>
<p>And load it, you don't need to rebuild</p>



<a name="202600805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600805">(Jul 01 2020 at 17:48)</a>:</h4>
<p>right, the catch is that cargo doesn't forward the json file later in the build</p>



<a name="202600930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600930">(Jul 01 2020 at 17:49)</a>:</h4>
<p>when I was pairing with steve last night, the json file was enough to build the bootstrap/dev step, but not enough to build any steps past that, I think</p>



<a name="202600965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202600965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202600965">(Jul 01 2020 at 17:49)</a>:</h4>
<p>I can reproduce the exact error, if that would help</p>



<a name="202601164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601164">(Jul 01 2020 at 17:51)</a>:</h4>
<p>I trust you <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span> Might be worth asking about the error and details in <a class="stream" data-stream-id="182449" href="/#narrow/stream/182449-t-compiler.2Fhelp">#t-compiler/help</a> , but rebuilding is a passable thing for now.</p>



<a name="202601186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601186">(Jul 01 2020 at 17:51)</a>:</h4>
<p>Are you performing incremental builds of rustc?</p>



<a name="202601192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601192">(Jul 01 2020 at 17:51)</a>:</h4>
<p>That saves a lot of time.</p>



<a name="202601403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601403">(Jul 01 2020 at 17:53)</a>:</h4>
<p>oh that's a very good idea, a new stage 1 is taking a very long time</p>



<a name="202601463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601463">(Jul 01 2020 at 17:54)</a>:</h4>
<p><code>./x.py -i ...</code></p>



<a name="202601559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601559">(Jul 01 2020 at 17:55)</a>:</h4>
<p>Once that's done, you can attempt to use your <code>build/x86_64-apple-darwin/stage1/bin/rustc</code> to cross-compile a program for the new target.</p>



<a name="202601606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601606">(Jul 01 2020 at 17:55)</a>:</h4>
<p>I'd start with just trying <code>..../rustc --target ... hello.rs</code></p>



<a name="202601644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601644">(Jul 01 2020 at 17:55)</a>:</h4>
<p>what! you mean rustc itself might be an ambitious first program! <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="202601691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601691">(Jul 01 2020 at 17:56)</a>:</h4>
<p>yesssssssss</p>



<a name="202601766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202601766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202601766">(Jul 01 2020 at 17:56)</a>:</h4>
<p>this will require that you have the various libraries installed, so I don't know if you want to do that on your x86 machine or the DTK.</p>



<a name="202602243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202602243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202602243">(Jul 01 2020 at 18:00)</a>:</h4>
<p>Circling back to the bootstrapping question... config.toml has a few related things:</p>
<div class="codehilite"><pre><span></span><code><span class="n">build-dir</span> <span class="o">=</span> <span class="s">&quot;build&quot;</span>
<span class="n">cargo</span> <span class="o">=</span> <span class="s">&quot;/path/to/cargo&quot;</span>
<span class="n">rustc</span> <span class="o">=</span> <span class="s">&quot;/path/to/bin/rustc&quot;</span>
</code></pre></div>



<a name="202602330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202602330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202602330">(Jul 01 2020 at 18:01)</a>:</h4>
<p>so you'd probably want to create a second directory (to avoid clobbering), then point that <code>rustc</code> to your <code>stage1/bin/rustc</code>.</p>



<a name="202602532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202602532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202602532">(Jul 01 2020 at 18:03)</a>:</h4>
<p>You might _also_ need to set</p>
<div class="codehilite"><pre><span></span><code><span class="c1"># In addition to the build triple, other triples to produce full compiler</span>
<span class="c1"># toolchains for. Each of these triples will be bootstrapped from the build</span>
<span class="c1"># triple and then will continue to bootstrap themselves. This platform must</span>
<span class="c1"># currently be able to run all of the triples provided here.</span>
<span class="c1">#host = [&quot;x86_64-unknown-linux-gnu&quot;]   # defaults to just the build triple</span>
</code></pre></div>


<p>Presumably to contain your new target name</p>



<a name="202602583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202602583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202602583">(Jul 01 2020 at 18:03)</a>:</h4>
<p>then you should have a <code>build/newtarget/stage1</code></p>



<a name="202602689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202602689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202602689">(Jul 01 2020 at 18:04)</a>:</h4>
<p>But if I'm reading the comment correctly, you'd <em>have</em> to run this on the DTK as that's the only machine that could run the x86_64 and arm code</p>



<a name="202608065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608065">(Jul 01 2020 at 18:45)</a>:</h4>
<p>yeah, that makes sense, I think</p>



<a name="202608124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608124">(Jul 01 2020 at 18:46)</a>:</h4>
<p>and if rust already had support for this triple, just setting <code>build</code> would probably suffice to bootstrap</p>



<a name="202608179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608179">(Jul 01 2020 at 18:46)</a>:</h4>
<p>do you happen to know why stage0 cargo appears to have statically linked openssl, but stage2 cargo has dynamically linked it?</p>



<a name="202608249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608249">(Jul 01 2020 at 18:47)</a>:</h4>
<p>(trying to use config.toml to manually point to rustc and cargo that include my target)</p>



<a name="202608284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608284">(Jul 01 2020 at 18:47)</a>:</h4>
<p>and I'm seeing these differing results from the stage0 and stage2 cargos:</p>



<a name="202608361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608361">(Jul 01 2020 at 18:48)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ../x86_64-apple-darwin/stage2-tools/x86_64-apple-darwin/release/cargo --version
dyld: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib
  Referenced from: /Users/andre/src/rust-lang/rust/../x86_64-apple-darwin/stage2-tools/x86_64-apple-darwin/release/cargo
  Reason: no suitable image found.  Did find:
    /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib: mach-o, but wrong architecture
    /usr/local/Cellar/openssl@1.1/1.1.1g/lib/libssl.1.1.dylib: mach-o, but wrong architecture
zsh: abort      ../x86_64-apple-darwin/stage2-tools/x86_64-apple-darwin/release/cargo
❯ ../x86_64-apple-darwin/stage0/bin/cargo --version
cargo 1.45.0-beta (744bd1fbb 2020-06-15)
</code></pre></div>



<a name="202608418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608418">(Jul 01 2020 at 18:48)</a>:</h4>
<p>(the DTK has, reasonably IMO, brewed openssl in aarch64 and not x86_64)</p>



<a name="202608796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608796">(Jul 01 2020 at 18:52)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="c1"># Indicates whether the native libraries linked into Cargo will be statically</span>
<span class="c1"># linked or not.</span>
<span class="c1">#cargo-native-static = false</span>
</code></pre></div>



<a name="202608815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608815">(Jul 01 2020 at 18:52)</a>:</h4>
<p>maybe just change that in config.toml?</p>



<a name="202608834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202608834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202608834">(Jul 01 2020 at 18:52)</a>:</h4>
<p>I don't know the <em>why</em> though</p>



<a name="202609192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202609192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202609192">(Jul 01 2020 at 18:56)</a>:</h4>
<p>oooo yes thank you</p>



<a name="202609236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202609236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202609236">(Jul 01 2020 at 18:56)</a>:</h4>
<p>I guess if you're building locally it's fine to dynamic-link to keep sizes down and whatnot</p>



<a name="202609264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202609264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202609264">(Jul 01 2020 at 18:57)</a>:</h4>
<p>and if you're building for binary distribution (like for stage0!) you want static linking, so it works on other machines</p>



<a name="202609303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202609303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202609303">(Jul 01 2020 at 18:57)</a>:</h4>
<p>time for some more compiling <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="202610061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610061">(Jul 01 2020 at 19:02)</a>:</h4>
<p>also, generally stage0 == the most recent beta.</p>



<a name="202610101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610101">(Jul 01 2020 at 19:03)</a>:</h4>
<p>in your case, you've got a few stage0 in play</p>



<a name="202610253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610253">(Jul 01 2020 at 19:04)</a>:</h4>
<p>yep, I am slowly figuring this out :)</p>



<a name="202610347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610347">(Jul 01 2020 at 19:05)</a>:</h4>
<p>I think what is currently happening is:</p>
<ol>
<li>edit targets on intel mac</li>
<li>compile stage2 rustc that knows about new targets</li>
<li>copy that rustc over to DTK, and use it as stage0</li>
</ol>



<a name="202610442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610442">(Jul 01 2020 at 19:05)</a>:</h4>
<p>I guess I could be copying stage1 over, it probably doesn't matter if rustc for x86 is compiled by rustc that knows about arm64</p>



<a name="202610576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610576">(Jul 01 2020 at 19:06)</a>:</h4>
<p>I would love to better understand how cargo works with this... it seems like <code>x.py build</code> only creates rustc, and I have to manually <code>x.py build cargo</code> to also get the cargo I can use for stage0 on the DTK, does that sound right to you?</p>



<a name="202610652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610652">(Jul 01 2020 at 19:07)</a>:</h4>
<p>And you can probably just build stage1.</p>



<a name="202610761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610761">(Jul 01 2020 at 19:08)</a>:</h4>
<p>yep, just figured that out above :)</p>



<a name="202610824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610824">(Jul 01 2020 at 19:08)</a>:</h4>
<p>You might even be able to skip building cargo; I don't see why you'd need it at all to start with, or couldn't use the x86_64 cargo as well</p>



<a name="202610858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610858">(Jul 01 2020 at 19:08)</a>:</h4>
<p>right, sorry, this is about the x86_64 cargo</p>



<a name="202610892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610892">(Jul 01 2020 at 19:08)</a>:</h4>
<p>on the intel mac, I am building a rustc that knows about the new target</p>



<a name="202610914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610914">(Jul 01 2020 at 19:09)</a>:</h4>
<p>copying that to DTK to use as stage0 rustc</p>



<a name="202610925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610925">(Jul 01 2020 at 19:09)</a>:</h4>
<p>but I also need a cargo that knows about the new target</p>



<a name="202610932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610932">(Jul 01 2020 at 19:09)</a>:</h4>
<p>to use as the stage0 cargo</p>



<a name="202610946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610946">(Jul 01 2020 at 19:09)</a>:</h4>
<p>something like <code>./x.py build -i --stage 1 src/libtest</code></p>



<a name="202610987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202610987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202610987">(Jul 01 2020 at 19:09)</a>:</h4>
<blockquote>
<p>a cargo that knows about the new target</p>
</blockquote>
<p>Why's that?</p>



<a name="202611057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202611057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202611057">(Jul 01 2020 at 19:10)</a>:</h4>
<p>because when I try to run <code>x.py build</code> on the DTK with a cargo that doesn't know about the new target, it fails with a cargo command that errors about not having the target :)</p>



<a name="202611094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202611094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202611094">(Jul 01 2020 at 19:10)</a>:</h4>
<p>hmm. I didn't think that cargo knew about the targets at all, delegating off to rustc.</p>



<a name="202611140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202611140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202611140">(Jul 01 2020 at 19:11)</a>:</h4>
<p>hmm, interesting! I will look more closely as soon as this rustc finishes building</p>



<a name="202611537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202611537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202611537">(Jul 01 2020 at 19:14)</a>:</h4>
<p>Cargo first runs <code>rustc -vV</code> to learn the host target and then runs <code>rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg</code> to learn everything else, including all enabled cfgs, which crate types are supported, how certain crate types get named. (eg <code>lib___.so</code> vs <code>___.dll</code> and <code>___</code> vs <code>___.exe</code>)</p>



<a name="202614952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202614952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202614952">(Jul 01 2020 at 19:41)</a>:</h4>
<p>ahh, yep, I faked myself out by trying to run the failing cargo command directly, which meant it was using the wrong rustc, and no longer knew about my target. thanks!</p>



<a name="202616917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202616917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202616917">(Jul 01 2020 at 19:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> okay I could use advice now <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> I have:</p>
<ol>
<li>added <code>aarch64-apple-darwin</code> and built stage1 on intel</li>
<li>copied all of stage1 to DTK</li>
<li>set config.toml thusly:</li>
</ol>
<div class="codehilite"><pre><span></span><code>cargo = &quot;/Users/andre/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo&quot;
rustc = &quot;/Users/andre/stage1/bin/rustc&quot;
rustfmt = &quot;/Users/andre/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/rustfmt&quot;
</code></pre></div>


<p>got a giant pile of cc/ld output about bad architectures: <a href="https://gist.github.com/indirect/d41d11e89d315edd553760c9689e4226">https://gist.github.com/indirect/d41d11e89d315edd553760c9689e4226</a></p>



<a name="202617127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202617127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202617127">(Jul 01 2020 at 20:00)</a>:</h4>
<p>(fwiw, I get the same error when I try to build without <code>-i</code>)</p>



<a name="202617299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202617299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202617299">(Jul 01 2020 at 20:01)</a>:</h4>
<blockquote>
<p>symbol(s) not found for architecture x86_64</p>
</blockquote>



<a name="202617400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202617400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202617400">(Jul 01 2020 at 20:02)</a>:</h4>
<p>so you have an x86 rustc and you are trying to build an arm rustc, skipping the hello world?</p>



<a name="202617534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202617534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202617534">(Jul 01 2020 at 20:03)</a>:</h4>
<blockquote>
<p>Building stage0 std artifacts (aarch64-apple-darwin -&gt; aarch64-apple-darwin)</p>
</blockquote>



<a name="202617546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202617546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202617546">(Jul 01 2020 at 20:03)</a>:</h4>
<p>hm</p>



<a name="202617744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202617744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202617744">(Jul 01 2020 at 20:05)</a>:</h4>
<p>I'd make sure that the files you've built are the appropriate arch. Something like <code>file /Users/andre/src/rust-lang/rust/build/aarch64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5a6e16530e74c59e.10hfa5qunoz4t80m.rcgu.o</code></p>



<a name="202617851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202617851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202617851">(Jul 01 2020 at 20:06)</a>:</h4>
<p>I have things like <code>Mach-O 64-bit object x86_64</code></p>



<a name="202617868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202617868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202617868">(Jul 01 2020 at 20:07)</a>:</h4>
<p>presumably yours should be different</p>



<a name="202618090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202618090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202618090">(Jul 01 2020 at 20:09)</a>:</h4>
<p>oh right, I totally meant to start with hello world <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span>🏻‍♂️</p>



<a name="202618105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202618105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202618105">(Jul 01 2020 at 20:09)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ~/stage1/bin/rustc hello.rs --target aarch64-apple-darwin
error[E0463]: can&#39;t find crate for `std`
  |
  = note: the `aarch64-apple-darwin` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
</code></pre></div>



<a name="202618170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202618170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202618170">(Jul 01 2020 at 20:10)</a>:</h4>
<p>hmmmm does that mean I didn't build std on my intel mac to copy over</p>



<a name="202618319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202618319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202618319">(Jul 01 2020 at 20:11)</a>:</h4>
<p>my files do seem to be the right arch:</p>



<a name="202618322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202618322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202618322">(Jul 01 2020 at 20:11)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ file /Users/andre/src/rust-lang/rust/build/aarch64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5a6e16530e74c59e.10hfa5qunoz4t80m.rcgu.o
/Users/andre/src/rust-lang/rust/build/aarch64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5a6e16530e74c59e.10hfa5qunoz4t80m.rcgu.o: Mach-O 64-bit object arm64
</code></pre></div>



<a name="202618756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202618756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202618756">(Jul 01 2020 at 20:14)</a>:</h4>
<p>Is there a stdlib and is it the right type?</p>
<div class="codehilite"><pre><span></span><code>% file build/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libstd-f48968273f376cb7.dylib
build/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libstd-f48968273f376cb7.dylib: Mach-O 64-bit dynamically linked shared library x86_64
</code></pre></div>



<a name="202619057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202619057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202619057">(Jul 01 2020 at 20:17)</a>:</h4>
<p>yes, it looks right:</p>
<div class="codehilite"><pre><span></span><code>❯ file ~/stage1/lib/rustlib/x86_64-apple-darwin/lib/libstd-a6381669d6483006.dylib
/Users/andre/stage1/lib/rustlib/x86_64-apple-darwin/lib/libstd-a6381669d6483006.dylib: Mach-O 64-bit dynamically linked shared library x86_64
</code></pre></div>



<a name="202620902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202620902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202620902">(Jul 01 2020 at 20:35)</a>:</h4>
<p>Ah, yours should be arm64</p>



<a name="202621080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202621080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202621080">(Jul 01 2020 at 20:37)</a>:</h4>
<p>Maybe in a sibling directory from what I pasted?</p>



<a name="202622362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202622362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202622362">(Jul 01 2020 at 20:49)</a>:</h4>
<p>oh sorry, backing all the way up to "can I compile <a href="http://hello.rs">hello.rs</a> for the new aarch64-apple-darwin target"</p>



<a name="202622500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202622500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202622500">(Jul 01 2020 at 20:51)</a>:</h4>
<p>I have copied stage1 (with the new target) from intel mac to DTK</p>



<a name="202622527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202622527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202622527">(Jul 01 2020 at 20:51)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ cat hello.rs
fn main() { println!(&quot;Hello World!&quot;); }
❯ ~/stage1/bin/rustc hello.rs
❯ ./hello
Hello World!
❯ file hello
hello: Mach-O 64-bit executable x86_64
❯ ~/stage1/bin/rustc hello.rs --target aarch64-apple-darwin
error[E0463]: can&#39;t find crate for `std`
  |
  = note: the `aarch64-apple-darwin` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
</code></pre></div>



<a name="202622757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202622757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202622757">(Jul 01 2020 at 20:54)</a>:</h4>
<p>so I guess this makes sense because my copied stage1 has a std for x86_64</p>



<a name="202622764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202622764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202622764">(Jul 01 2020 at 20:54)</a>:</h4>
<p>but not for aarch64</p>



<a name="202623070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623070">(Jul 01 2020 at 20:57)</a>:</h4>
<p>(deleted)</p>



<a name="202623127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623127">(Jul 01 2020 at 20:57)</a>:</h4>
<p>(deleted)</p>



<a name="202623207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623207">(Jul 01 2020 at 20:58)</a>:</h4>
<p>(deleted)</p>



<a name="202623302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623302">(Jul 01 2020 at 20:58)</a>:</h4>
<p>(deleted)</p>



<a name="202623516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623516">(Jul 01 2020 at 21:00)</a>:</h4>
<p>so maybe now my goal is to use the intel rustc to build an aarch64 std?</p>



<a name="202623669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623669">(Jul 01 2020 at 21:02)</a>:</h4>
<p>oh that is literally the crate that fails <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="202623786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623786">(Jul 01 2020 at 21:03)</a>:</h4>
<p>I guess now I get your earlier question, heh</p>



<a name="202623993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623993">(Jul 01 2020 at 21:05)</a>:</h4>
<p>I don't have anything in stage1 for aarch64, just a bunch of empty folders:</p>



<a name="202623998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202623998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202623998">(Jul 01 2020 at 21:05)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ find build/aarch64-apple-darwin/stage1 -type file
</code></pre></div>



<a name="202624607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202624607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202624607">(Jul 01 2020 at 21:11)</a>:</h4>
<p>I guess now I am looped back around to <code>python x.py build -i --stage 1 --target aarch64-apple-darwin</code> and that giant error from before: <a href="https://gist.githubusercontent.com/indirect/d41d11e89d315edd553760c9689e4226/raw/d5a4aac799e12889db457c830e46c5aa66f5ec50/gistfile1.txt">https://gist.githubusercontent.com/indirect/d41d11e89d315edd553760c9689e4226/raw/d5a4aac799e12889db457c830e46c5aa66f5ec50/gistfile1.txt</a></p>



<a name="202624615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202624615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202624615">(Jul 01 2020 at 21:11)</a>:</h4>
<p>not sure where to go from here :)</p>



<a name="202628230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202628230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202628230">(Jul 01 2020 at 21:50)</a>:</h4>
<blockquote>
<div class="codehilite"><pre><span></span><code>     ld: warning: ignoring file /Users/andre/src/rust-lang/rust/build/aarch64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5a6e16530e74c59e.2kfncgnake9pkvcr.rcgu.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
</code></pre></div>


</blockquote>



<a name="202628294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202628294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202628294">(Jul 01 2020 at 21:50)</a>:</h4>
<p>hmmmmmmm</p>



<a name="202628360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202628360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202628360">(Jul 01 2020 at 21:51)</a>:</h4>
<p>maybe I mixed and matched configs and target options</p>



<a name="202628535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202628535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202628535">(Jul 01 2020 at 21:53)</a>:</h4>
<p>no, I guess not</p>



<a name="202628623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202628623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202628623">(Jul 01 2020 at 21:54)</a>:</h4>
<p>why is it saying <code>building for macOS-x86_64 but attempting to link with file built for unknown-arm64</code> when I run <code>x.py build --stage 1 --target aarch64-apple-darwin</code></p>



<a name="202628657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202628657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202628657">(Jul 01 2020 at 21:55)</a>:</h4>
<p>maybe something still wrong with the target definition? but I don't know what</p>



<a name="202634429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202634429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202634429">(Jul 01 2020 at 23:12)</a>:</h4>
<p>Have you compiled a native C hello world?</p>



<a name="202634705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202634705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202634705">(Jul 01 2020 at 23:16)</a>:</h4>
<p>Sadly, I think that people without the DTK aren’t allowed to look at the docs or download the Xcode that allows cross compiling.</p>



<a name="202634721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202634721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202634721">(Jul 01 2020 at 23:17)</a>:</h4>
<p>(I’d love to be proven wrong about that)</p>



<a name="202634848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202634848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> David Jensenius <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202634848">(Jul 01 2020 at 23:19)</a>:</h4>
<p>You can download the cross compiling Xcode without the DTK</p>



<a name="202636873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202636873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202636873">(Jul 01 2020 at 23:50)</a>:</h4>
<p>Aha: <code>$(CC) main.c -o arm_app -target arm64-apple-macos11</code></p>



<a name="202637657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202637657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202637657">(Jul 02 2020 at 00:03)</a>:</h4>
<p>I kind of hope that <code>cc</code> would default to targeting the native platform</p>



<a name="202637721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202637721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202637721">(Jul 02 2020 at 00:04)</a>:</h4>
<p>Could be worth doing a <code>cc hello.c</code> and checking that it produces an arm executable</p>



<a name="202638185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202638185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202638185">(Jul 02 2020 at 00:10)</a>:</h4>
<p>"built for unknown-arm64" is also suspicious.</p>



<a name="202639006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202639006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202639006">(Jul 02 2020 at 00:22)</a>:</h4>
<p>ah yeah good point</p>



<a name="202639527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202639527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202639527">(Jul 02 2020 at 00:31)</a>:</h4>
<p>it does work reasonably:</p>
<div class="codehilite"><pre><span></span><code>❯ /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk hello.c -o hello
❯ file hello
hello: Mach-O 64-bit executable arm64
❯ ./hello
Hello, World!%
</code></pre></div>



<a name="202639541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202639541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202639541">(Jul 02 2020 at 00:31)</a>:</h4>
<p>without passing -target</p>



<a name="202639548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202639548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202639548">(Jul 02 2020 at 00:31)</a>:</h4>
<p>(although $CC contains -arch arm64)</p>



<a name="202641559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202641559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202641559">(Jul 02 2020 at 01:18)</a>:</h4>
<p>I wonder if you need to add that arch to what rust uses as cc</p>



<a name="202643259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643259">(Jul 02 2020 at 01:59)</a>:</h4>
<p>I'm trying to install the Xcode 12 beta myself, even though I won't be able to run anything. I can just feel that I'm gonna regret this decision.</p>



<a name="202643715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643715">(Jul 02 2020 at 02:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> <a href="#narrow/stream/242906-t-compiler.2Farm/topic/macOS.20initial.20cross-compile/near/202641559">said</a>:</p>
<blockquote>
<p>I wonder if you need to add that arch to what rust uses as cc</p>
</blockquote>
<p>how do I edit rust's CC?</p>



<a name="202643776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643776">(Jul 02 2020 at 02:10)</a>:</h4>
<p>in config.toml, there are platform specific sections, like <code>[target.x86_64-apple-darwin]</code>. You can specify the linker there</p>



<a name="202643809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643809">(Jul 02 2020 at 02:11)</a>:</h4>
<p>ahh, ok... let's see...</p>



<a name="202643857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643857">(Jul 02 2020 at 02:12)</a>:</h4>
<p>You could try </p>
<div class="codehilite"><pre><span></span><code><span class="k">[target.whatever-you-picked]</span>
<span class="n">linker</span> <span class="o">=</span> <span class="s">&quot;cc -arch arm64&quot;</span>
</code></pre></div>



<a name="202643865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643865">(Jul 02 2020 at 02:12)</a>:</h4>
<p>wouldn't the linker be ld?</p>



<a name="202643867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643867">(Jul 02 2020 at 02:12)</a>:</h4>
<p>I know nothing <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="202643870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643870">(Jul 02 2020 at 02:12)</a>:</h4>
<p>oh I see, the default is cc</p>



<a name="202643884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643884">(Jul 02 2020 at 02:13)</a>:</h4>
<p>however, that <em>feels</em> suspicious to have arguments in there. You <em>may</em> need to write a little shell script that takes all the args it's passed and adds <code>-arch ...</code> and calls <code>cc</code></p>



<a name="202643887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643887">(Jul 02 2020 at 02:13)</a>:</h4>
<p><code>cc</code> will call <code>ld</code></p>



<a name="202643889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643889">(Jul 02 2020 at 02:13)</a>:</h4>
<p>got it</p>



<a name="202643900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643900">(Jul 02 2020 at 02:13)</a>:</h4>
<p>(cc will call clang which calls clang which calls ld, I think)</p>



<a name="202643904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643904">(Jul 02 2020 at 02:13)</a>:</h4>
<p>if I'm going to use options I might as well throw the entire $CC in there right</p>



<a name="202643908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643908">(Jul 02 2020 at 02:13)</a>:</h4>
<div class="codehilite"><pre><span></span><code>/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk
</code></pre></div>



<a name="202643960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643960">(Jul 02 2020 at 02:14)</a>:</h4>
<p>ohhh yeah you're right, it passes that as the option -C to rustc</p>



<a name="202643962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643962">(Jul 02 2020 at 02:14)</a>:</h4>
<p>I don't have a good answer for that; so try one way and then the other if it doesn't work ;-)</p>



<a name="202643963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643963">(Jul 02 2020 at 02:14)</a>:</h4>
<p>flags are not gonna work haha</p>



<a name="202643973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643973">(Jul 02 2020 at 02:15)</a>:</h4>
<p>a little bash or zsh will go a long way</p>



<a name="202643978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202643978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202643978">(Jul 02 2020 at 02:15)</a>:</h4>
<p>I'm a little surprised there's not a linker flags option</p>



<a name="202644045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644045">(Jul 02 2020 at 02:17)</a>:</h4>
<p>!!</p>



<a name="202644046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644046">(Jul 02 2020 at 02:17)</a>:</h4>
<p>you were right!</p>



<a name="202644047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644047">(Jul 02 2020 at 02:17)</a>:</h4>
<p>new error</p>



<a name="202644049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644049">(Jul 02 2020 at 02:17)</a>:</h4>
<p><code>ld: warning: ignoring file /Users/andre/stage1/lib/rustlib/x86_64-apple-darwin/lib/libcore-196e45adfb362f8f.rlib, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: entry point (_main) undefined. for architecture arm64</code></p>



<a name="202644070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644070">(Jul 02 2020 at 02:17)</a>:</h4>
<p>which honestly might just be cached artifacts</p>



<a name="202644110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644110">(Jul 02 2020 at 02:18)</a>:</h4>
<p>Kinda what I was wondering</p>



<a name="202644121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644121">(Jul 02 2020 at 02:18)</a>:</h4>
<p>haha I guess not</p>



<a name="202644122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644122">(Jul 02 2020 at 02:18)</a>:</h4>
<p>darn</p>



<a name="202644167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644167">(Jul 02 2020 at 02:19)</a>:</h4>
<p>that does feel like progress though</p>



<a name="202644261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644261">(Jul 02 2020 at 02:21)</a>:</h4>
<p>so I get that same error even if I <code>rm -rf build</code> and start again from scratch</p>



<a name="202644275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644275">(Jul 02 2020 at 02:21)</a>:</h4>
<p>You rebuilt llvm that quick?</p>



<a name="202644350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644350">(Jul 02 2020 at 02:23)</a>:</h4>
<p>no, it fails during bootstrap</p>



<a name="202644354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644354">(Jul 02 2020 at 02:23)</a>:</h4>
<p>(if using my cc_arm64 script)</p>



<a name="202644357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644357">(Jul 02 2020 at 02:23)</a>:</h4>
<p>it does not fail during bootstrap if I leave it set to the default cc</p>



<a name="202644371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644371">(Jul 02 2020 at 02:23)</a>:</h4>
<p>I have never gotten to the llvm building step on the DTK, that happens after the stage0 failure I'm seeing</p>



<a name="202644518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644518">(Jul 02 2020 at 02:26)</a>:</h4>
<p><a href="/user_uploads/4715/I2sNWR3pA4FTUOx-3ELFyrp1/CleanShot-2020-07-01-at-19.25.212x.jpg">CleanShot-2020-07-01-at-19.25.212x.jpg</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/I2sNWR3pA4FTUOx-3ELFyrp1/CleanShot-2020-07-01-at-19.25.212x.jpg" title="CleanShot-2020-07-01-at-19.25.212x.jpg"><img src="/user_uploads/4715/I2sNWR3pA4FTUOx-3ELFyrp1/CleanShot-2020-07-01-at-19.25.212x.jpg"></a></div>



<a name="202644937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644937">(Jul 02 2020 at 02:36)</a>:</h4>
<p>my new idea is that maybe rosetta is messing us up</p>



<a name="202644945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202644945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202644945">(Jul 02 2020 at 02:36)</a>:</h4>
<p>and if we run the x86_64 rustc via rosetta, it can only ever produce x86_86 rustc</p>



<a name="202645242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202645242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202645242">(Jul 02 2020 at 02:44)</a>:</h4>
<p>It’s possible; but that would be highly unexpected.</p>



<a name="202675134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202675134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202675134">(Jul 02 2020 at 11:18)</a>:</h4>
<p>I feel like the bootstrap shouldn’t be built for the target (arm)</p>



<a name="202675164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202675164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202675164">(Jul 02 2020 at 11:19)</a>:</h4>
<p>I wonder if you should start by setting host to x86</p>



<a name="202675183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202675183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202675183">(Jul 02 2020 at 11:19)</a>:</h4>
<p>And only make arm an additional target</p>



<a name="202676994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202676994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202676994">(Jul 02 2020 at 11:46)</a>:</h4>
<p>Can you share the output of <code>rustc -Z unstable-options --print target-spec-json</code> ?</p>



<a name="202677010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202677010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202677010">(Jul 02 2020 at 11:47)</a>:</h4>
<p>Curious what your fully-resolved options are</p>



<a name="202691726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202691726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202691726">(Jul 02 2020 at 13:59)</a>:</h4>
<p>I think I found the source of that jemalloc warning <a href="/user_uploads/4715/yLgm66B2vl_jomsZRcabOULt/Screenshot-2020-07-02-at-15.52.53.png">Screenshot-2020-07-02-at-15.52.53.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/yLgm66B2vl_jomsZRcabOULt/Screenshot-2020-07-02-at-15.52.53.png" title="Screenshot-2020-07-02-at-15.52.53.png"><img src="/user_uploads/4715/yLgm66B2vl_jomsZRcabOULt/Screenshot-2020-07-02-at-15.52.53.png"></a></div>



<a name="202691915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202691915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202691915">(Jul 02 2020 at 14:00)</a>:</h4>
<p><span class="user-mention" data-user-id="317220">@André Arko</span> If you haven't already watched it I would recommend watching Apple's video on porting your app to Apple Silicon. He mentions a couple of the errors you're saying you're getting. <a href="https://developer.apple.com/videos/play/wwdc2020/10214/">https://developer.apple.com/videos/play/wwdc2020/10214/</a></p>



<a name="202744629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744629">(Jul 02 2020 at 21:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> here's the target spec:</p>



<a name="202744630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744630">(Jul 02 2020 at 21:06)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ rustc -Z unstable-options --print target-spec-json
&lt;jemalloc&gt;: Unsupported system page size
{
  &quot;abi-return-struct-as-int&quot;: true,
  &quot;arch&quot;: &quot;x86_64&quot;,
  &quot;archive-format&quot;: &quot;darwin&quot;,
  &quot;cpu&quot;: &quot;core2&quot;,
  &quot;data-layout&quot;: &quot;e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128&quot;,
  &quot;dll-suffix&quot;: &quot;.dylib&quot;,
  &quot;dynamic-linking&quot;: true,
  &quot;eliminate-frame-pointer&quot;: false,
  &quot;emit-debug-gdb-scripts&quot;: false,
  &quot;env&quot;: &quot;&quot;,
  &quot;executables&quot;: true,
  &quot;function-sections&quot;: false,
  &quot;has-elf-tls&quot;: true,
  &quot;has-rpath&quot;: true,
  &quot;is-builtin&quot;: true,
  &quot;is-like-osx&quot;: true,
  &quot;link-env&quot;: [
    &quot;ZERO_AR_DATE=1&quot;
  ],
  &quot;link-env-remove&quot;: [
    &quot;IPHONEOS_DEPLOYMENT_TARGET&quot;
  ],
  &quot;linker-flavor&quot;: &quot;gcc&quot;,
  &quot;llvm-target&quot;: &quot;x86_64-apple-macosx10.7.0&quot;,
  &quot;max-atomic-width&quot;: 128,
  &quot;os&quot;: &quot;macos&quot;,
  &quot;pre-link-args&quot;: {
    &quot;gcc&quot;: [
      &quot;-m64&quot;
    ]
  },
  &quot;stack-probes&quot;: true,
  &quot;target-c-int-width&quot;: &quot;32&quot;,
  &quot;target-endian&quot;: &quot;little&quot;,
  &quot;target-family&quot;: &quot;unix&quot;,
  &quot;target-mcount&quot;: &quot;\u0001mcount&quot;,
  &quot;target-pointer-width&quot;: &quot;64&quot;,
  &quot;vendor&quot;: &quot;apple&quot;
}
</code></pre></div>



<a name="202744677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744677">(Jul 02 2020 at 21:07)</a>:</h4>
<p>wait... what</p>



<a name="202744686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744686">(Jul 02 2020 at 21:07)</a>:</h4>
<p>heh</p>



<a name="202744689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744689">(Jul 02 2020 at 21:07)</a>:</h4>
<p>that is clearly wrong</p>



<a name="202744697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744697">(Jul 02 2020 at 21:07)</a>:</h4>
<p>omg I just ran it on my laptop maybe <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span>🏻‍♂️</p>



<a name="202744827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744827">(Jul 02 2020 at 21:08)</a>:</h4>
<p>okay! good/bad news</p>



<a name="202744843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744843">(Jul 02 2020 at 21:09)</a>:</h4>
<p>this is the stage1 rustc I built on x86_64</p>



<a name="202744856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744856">(Jul 02 2020 at 21:09)</a>:</h4>
<p>so when I run it, it thinks it's running on x86_64</p>



<a name="202744869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744869">(Jul 02 2020 at 21:09)</a>:</h4>
<p>but it does know about the target I added:</p>



<a name="202744875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744875">(Jul 02 2020 at 21:09)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ~/stage1/bin/rustc -Z unstable-options --print target-spec-json --target aarch64-apple-darwin
{
  &quot;abi-blacklist&quot;: [
    &quot;stdcall&quot;,
    &quot;fastcall&quot;,
    &quot;vectorcall&quot;,
    &quot;thiscall&quot;,
    &quot;win64&quot;,
    &quot;sysv64&quot;
  ],
  &quot;abi-return-struct-as-int&quot;: true,
  &quot;arch&quot;: &quot;aarch64&quot;,
  &quot;archive-format&quot;: &quot;darwin&quot;,
  &quot;data-layout&quot;: &quot;e-m:o-i64:64-i128:128-n32:64-S128&quot;,
  &quot;dll-suffix&quot;: &quot;.dylib&quot;,
  &quot;dynamic-linking&quot;: true,
  &quot;eliminate-frame-pointer&quot;: false,
  &quot;emit-debug-gdb-scripts&quot;: false,
  &quot;env&quot;: &quot;&quot;,
  &quot;executables&quot;: true,
  &quot;features&quot;: &quot;+neon,+fp-armv8,+apple-a7&quot;,
  &quot;function-sections&quot;: false,
  &quot;has-elf-tls&quot;: true,
  &quot;has-rpath&quot;: true,
  &quot;is-builtin&quot;: true,
  &quot;is-like-osx&quot;: true,
  &quot;link-env&quot;: [
    &quot;ZERO_AR_DATE=1&quot;
  ],
  &quot;linker-flavor&quot;: &quot;gcc&quot;,
  &quot;llvm-target&quot;: &quot;aarch64-apple-macosx10.7.0&quot;,
  &quot;max-atomic-width&quot;: 128,
  &quot;os&quot;: &quot;macos&quot;,
  &quot;target-c-int-width&quot;: &quot;32&quot;,
  &quot;target-endian&quot;: &quot;little&quot;,
  &quot;target-family&quot;: &quot;unix&quot;,
  &quot;target-pointer-width&quot;: &quot;64&quot;,
  &quot;vendor&quot;: &quot;apple&quot;
}
</code></pre></div>



<a name="202744948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744948">(Jul 02 2020 at 21:10)</a>:</h4>
<p>default target when running rustc via rosetta is definitely x86:</p>



<a name="202744955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202744955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202744955">(Jul 02 2020 at 21:10)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ~/stage1/bin/rustc -Z unstable-options --print target-spec-json
{
  &quot;abi-return-struct-as-int&quot;: true,
  &quot;arch&quot;: &quot;x86_64&quot;,
  &quot;archive-format&quot;: &quot;darwin&quot;,
  &quot;cpu&quot;: &quot;core2&quot;,
  &quot;data-layout&quot;: &quot;e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128&quot;,
  &quot;dll-suffix&quot;: &quot;.dylib&quot;,
  &quot;dynamic-linking&quot;: true,
  &quot;eliminate-frame-pointer&quot;: false,
  &quot;emit-debug-gdb-scripts&quot;: false,
  &quot;env&quot;: &quot;&quot;,
  &quot;executables&quot;: true,
  &quot;function-sections&quot;: false,
  &quot;has-elf-tls&quot;: true,
  &quot;has-rpath&quot;: true,
  &quot;is-builtin&quot;: true,
  &quot;is-like-osx&quot;: true,
  &quot;link-env&quot;: [
    &quot;ZERO_AR_DATE=1&quot;
  ],
  &quot;link-env-remove&quot;: [
    &quot;IPHONEOS_DEPLOYMENT_TARGET&quot;
  ],
  &quot;linker-flavor&quot;: &quot;gcc&quot;,
  &quot;llvm-target&quot;: &quot;x86_64-apple-macosx10.7.0&quot;,
  &quot;max-atomic-width&quot;: 128,
  &quot;os&quot;: &quot;macos&quot;,
  &quot;pre-link-args&quot;: {
    &quot;gcc&quot;: [
      &quot;-m64&quot;
    ]
  },
  &quot;stack-probes&quot;: true,
  &quot;target-c-int-width&quot;: &quot;32&quot;,
  &quot;target-endian&quot;: &quot;little&quot;,
  &quot;target-family&quot;: &quot;unix&quot;,
  &quot;target-mcount&quot;: &quot;\u0001mcount&quot;,
  &quot;target-pointer-width&quot;: &quot;64&quot;,
  &quot;vendor&quot;: &quot;apple&quot;
}
</code></pre></div>



<a name="202745918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202745918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202745918">(Jul 02 2020 at 21:19)</a>:</h4>
<p>so the default being wrong is probably some of the problem</p>



<a name="202745979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202745979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202745979">(Jul 02 2020 at 21:20)</a>:</h4>
<p>I guess I've been trying to build an x86 rust from an x86 rust, but on arm64 :P</p>



<a name="202747021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20initial%20cross-compile/near/202747021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20initial.20cross-compile.html#202747021">(Jul 02 2020 at 21:32)</a>:</h4>
<p>That makes sense. Much like code running in a VM doesn’t know it’s a VM (usually)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>